home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / e / AEPD09.lha / EPD09 / Amiga_E-Programme / ESEE / GoldED / Parsers / OBJECT.devpac < prev    next >
Text File  |  1994-08-18  |  2KB  |  75 lines

  1. *
  2. * OBJECT.devpac - by Leon Woestenberg 1993, fully public domain.
  3. * ~~~~~~~~~~~~~
  4. * Description
  5. * ~~~~~~~~~~~
  6. * ESEE 'OBJECT' Section Parser in assembly language.
  7. *
  8. * Function
  9. * ~~~~~~~~
  10. * Can be called by GoldED to parse one line for OBJECT indexing.
  11. *
  12. * Input (comes from GoldED)
  13. * ~~~~~
  14. * a0 - address of stringpointer to line
  15. * d0 - length of the line
  16. *
  17. * Output (goes to GoldED)
  18. * ~~~~~~
  19. * a0 - address of stringpointer to objectname
  20. * d0 - length of functionname
  21. *
  22. * GoldED Settings
  23. * ~~~~~~~~~~~~~~~
  24. * It's advicable to set the file extension to '*.e' for this parser. This
  25. * can be done in GoldED's Sections window called by GoldED's FUNC command.
  26. *
  27.  
  28.         move.l  a1,-(a7)        * store a1
  29.         move.l  (a0),a1         * stringpointer to a1
  30.         cmp.b   #40,(a1)        * char (?
  31.         bne     not
  32.         cmp.b   #45,1(a1)       * char -?
  33.         bne     not
  34.         cmp.b   #45,2(a1)       * char -?
  35.         bne     not
  36.         cmp.b   #45,3(a1)       * char -?
  37.         bne     not
  38.         cmp.b   #41,4(a1)       * char )?
  39.         bne     not
  40.         cmp.b   #32,5(a1)       * space?
  41.         bne     not
  42.         cmp.b   #79,6(a1)       * char O?
  43.         bne     not
  44.         cmp.b   #66,7(a1)       * char B?
  45.         bne     not
  46.         cmp.b   #74,8(a1)       * char J?
  47.         bne     not
  48.         cmp.b   #69,9(a1)       * char E?
  49.         bne     not
  50.         cmp.b   #67,10(a1)      * char C?
  51.         bne     not
  52.         cmp.b   #84,11(a1)      * char T?
  53.         bne     not
  54.         cmp.b   #32,12(a1)      * space?
  55.         bne     not
  56.         add.l   #13,a1          * stringpointer to functionname
  57.         add.l   #13,(a0)        * idem dito
  58.         sub.l   #13,d0          * substract OBJECT header length
  59.  
  60.         move.l  d0,d1           * copy string length to d1
  61.         clr.l   d0              * initialize d0 for search
  62. find:
  63.         cmp.b   #32,(a1)        * space? (to skip remarks)
  64.         beq     end
  65.         add.l   #1,a1           * increase charpointer
  66.         add.l   #1,d0           * increase length
  67.         cmp.b   d0,d1           * eol?
  68.         beq     end
  69.         jmp     find            * check next char
  70. not:
  71.         clr.l   d0              * no success, return zero
  72. end:
  73.         move.l  (a7)+,a1        * restore a1
  74.         rts                     * bye bye
  75.